'use strict';

app.controller('viewMonthChangeCtrl', function($element, $scope, $state, rest, user, $rootScope, ngDialog, uiLoad, $timeout, $window, $ocLazyLoad, uploadConf, uploadprefix, tipService) {
    var data = angular.copy($scope.ngDialogData, {});
    var token = $window.localStorage.getItem("token");

    $scope.$on('msg2', function(e, msg) {
        $scope.confirm({});
    });

    $scope.cancelRepay = function() {
        $scope.closeThisDialog();
    }
    $('.waitAlert').css('display','block');
    rest.decoJava({
        type: "post",
        url: "/tenancy-sys/admin/decorateOrderInfo/checkConversionData",
        data: {
            id: data.id
        },
        beforeSend: function(request) {
            request.setRequestHeader("token", token);
        },
        success: function(data) {
            if (data.code == "0000") {
                $scope.myData = data.result;
                $scope.$apply();
                $('.waitAlert').css('display','none');
            } else {
                tipService.show("body", {
                    message: data.message,
                    notice: "danger"
                }, 3);
            }

        }
    });

});